# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=appstream-generator
pkgver=0.9.1
pkgrel=1
pkgdesc='A fast AppStream metadata generator'
arch=(loong64 x86_64)
url='https://github.com/ximion/appstream-generator'
license=(GPL3)
depends=(appstream
         gcc-libs
         gdk-pixbuf2
         glib2
         glibc
         glibd
         libarchive
         liblphobos
         lmdb
         optipng)
makedepends=(curl
             docbook-xsl
             gir-to-d
             gobject-introspection
             ldc
             meson
             mustache-d
             ninja)
source=(https://github.com/ximion/appstream-generator/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('b3f8ea7c7cbcce3328319fc655a83e6464e9d1ba57d27e037043ff7123f6930d')

build() {
  export LDFLAGS="$(echo -ne $LDFLAGS | sed -e 's/-flto=auto/-flto=full/')"
  arch-meson $pkgname-$pkgver build -D download-js=false
  meson compile -C build
}

package() {
  meson install -C build --destdir="$pkgdir"
}
